package paopaoteacher;
/*
百钱白鸡
    鸡翁一值钱五，鸡母一值钱三，鸡雏三值钱一，
    百钱买百鸡，问鸡翁 鸡母 鸡雏各多少只？
    设鸡翁x只 鸡母y只 鸡雏z只  那么5x+3y+z/3=100  x+y+z=100
    0<=x<=20     0<=y<=33   0<=z<=100
 */
public class P04 {
    public static void main(String[] args) {
        for (int x = 0; x <= 20; x++) {
            for (int y = 0; y <= 33; y++) {
                int z=100-x-y;
                if (z%3==0&&5*x+3*y+z/3==100){
                    System.out.println(x+","+y+","+z);
                }
            }
        }

    }
}
